home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16.lha / Python-1.6 / Docs / NEWS < prev    next >
Encoding:
Text File  |  2000-09-05  |  10.8 KB  |  310 lines

  1. What's new in release 1.6?
  2. ==========================
  3.  
  4. Below is a list of all relevant changes since release 1.5.2.  Older
  5. changes are in the file HISTORY.
  6.  
  7. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
  8.  
  9. ======================================================================
  10.  
  11. Source Incompatibilities
  12. ------------------------
  13.  
  14. Several small incompatible library changes may trip you up:
  15.  
  16.   - The append() method for lists can no longer be invoked with more
  17.   than one argument.  This used to append a single tuple made out of
  18.   all arguments, but was undocumented.  To append a tuple, use
  19.   e.g. l.append((a, b, c)).
  20.  
  21.   - The connect(), connect_ex() and bind() methods for sockets require
  22.   exactly one argument.  Previously, you could call s.connect(host,
  23.   port), but this was undocumented. You must now write
  24.   s.connect((host, port)).
  25.  
  26.   - The str() and repr() functions are now different more often.  For
  27.   long integers, str() no longer appends a 'L'.  Thus, str(1L) == '1',
  28.   which used to be '1L'; repr(1L) is unchanged and still returns '1L'.
  29.   For floats, repr() now gives 17 digits of precision, to ensure no
  30.   precision is lost (on all current hardware).
  31.  
  32.   - The -X option is gone.  Built-in exceptions are now always
  33.   classes.  Many more library modules also have been converted to
  34.   class-based exceptions.
  35.  
  36.  
  37. Binary Incompatibilities
  38. ------------------------
  39.  
  40. - Third party extensions built for Python 1.5.x cannot be used with
  41. Python 1.6; these extensions will have to be rebuilt for Python 1.6.
  42.  
  43. - On Windows, attempting to import a third party extension built for
  44. Python 1.5.x results in an immediate crash; there's not much we can do
  45. about this.  Check your PYTHONPATH environment variable!
  46.  
  47.  
  48. Overview of Changes since 1.5.2
  49. -------------------------------
  50.  
  51. For this overview, I have borrowed from the document "What's New in
  52. Python 2.0" by Andrew Kuchling and Moshe Zadka:
  53. http://starship.python.net/crew/amk/python/writing/new-python/.
  54.  
  55. There are lots of new modules and lots of bugs have been fixed.  A
  56. list of all new modules is included below.
  57.  
  58. Probably the most pervasive change is the addition of Unicode support.
  59. We've added a new fundamental datatype, the Unicode string, a new
  60. build-in function unicode(), an numerous C APIs to deal with Unicode
  61. and encodings.  See the file Misc/unicode.txt for details, or
  62. http://starship.python.net/crew/lemburg/unicode-proposal.txt.
  63.  
  64. Two other big changes, related to the Unicode support, are the
  65. addition of string methods and (yet another) new regular expression
  66. engine.
  67.  
  68.   - String methods mean that you can now say s.lower() etc. instead of
  69.   importing the string module and saying string.lower(s) etc.  One
  70.   peculiarity is that the equivalent of string.join(sequence,
  71.   delimiter) is delimiter.join(sequence).  Use " ".join(sequence) for
  72.   the effect of string.join(sequence); to make this more readable, try
  73.   space=" " first.  Note that the maxsplit argument defaults in
  74.   split() and replace() have changed from 0 to -1.
  75.  
  76.   - The new regular expression engine, SRE by Fredrik Lundh, is fully
  77.   backwards compatible with the old engine, and is in fact invoked
  78.   using the same interface (the "re" module).  You can explicitly
  79.   invoke the old engine by import pre, or the SRE engine by importing
  80.   sre.  SRE is faster than pre, and supports Unicode (which was the
  81.   main reason to put effort in yet another new regular expression
  82.   engine -- this is at least the fourth!).
  83.  
  84.  
  85. Other Changes
  86. -------------
  87.  
  88. Other changes that won't break code but are nice to know about:
  89.  
  90. Deleting objects is now safe even for deeply nested data structures.
  91.  
  92. Long/int unifications: long integers can be used in seek() calls, as
  93. slice indexes.
  94.  
  95. String formatting (s % args) has a new formatting option, '%r', which
  96. acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in
  97. alpha 1.)
  98.  
  99. Greg Ward's "distutils" package is included: this will make
  100. installing, building and distributing third party packages much
  101. simpler.
  102.  
  103. There's now special syntax that you can use instead of the apply()
  104. function.  f(*args, **kwds) is equivalent to apply(f, args, kwds).
  105. You can also use variations f(a1, a2, *args, **kwds) and you can leave
  106. one or the other out: f(*args), f(**kwds).
  107.  
  108. The built-ins int() and long() take an optional second argument to
  109. indicate the conversion base -- of course only if the first argument
  110. is a string.  This makes string.atoi() and string.atol() obsolete.
  111. (string.atof() was already obsolete).
  112.  
  113. When a local variable is known to the compiler but undefined when
  114. used, a new exception UnboundLocalError is raised.  This is a class
  115. derived from NameError so code catching NameError should still work.
  116. The purpose is to provide better diagnostics in the following example:
  117.   x = 1
  118.   def f():
  119.       print x
  120.       x = x+1
  121. This used to raise a NameError on the print statement, which confused
  122. even experienced Python programmers (especially if there are several
  123. hundreds of lines of code between the reference and the assignment to
  124. x :-).
  125.  
  126. You can now override the 'in' operator by defining a __contains__
  127. method.  Note that it has its arguments backwards: x in a causes
  128. a.__contains__(x) to be called.  That's why the name isn't __in__.
  129.  
  130. The exception AttributeError will have a more friendly error message,
  131. e.g.: <code>'Spam' instance has no attribute 'eggs'</code>.  This may
  132. <b>break code</b> that expects the message to be exactly the attribute
  133. name.
  134.  
  135. Vladimir Marangozov designed more rational C APIs for allocating
  136. memory.  See mymalloc.h.
  137.  
  138.  
  139. New Modules in 1.6
  140. ------------------
  141.  
  142. UserString - base class for deriving from the string type.
  143.  
  144. distutils - tools for distributing Python modules.
  145.  
  146. robotparser - parse a robots.txt file, for writing web spiders.
  147. (Moved from Tools/webchecker/.)
  148.  
  149. linuxaudiodev - audio for Linux.
  150.  
  151. mmap - treat a file as a memory buffer.  (Windows and Unix.)
  152.  
  153. sre - regular expressions (fast, supports unicode).  Currently, this
  154. code is very rough.  Eventually, the re module will be reimplemented
  155. using sre (without changes to the re API).
  156.  
  157. filecmp - supersedes the old cmp.py and dircmp.py modules.
  158.  
  159. tabnanny - check Python sources for tab-width dependance.  (Moved from
  160. Tools/scripts/.)
  161.  
  162. urllib2 - new and improved but incompatible version of urllib (still
  163. experimental).
  164.  
  165. zipfile - read and write zip archives.
  166.  
  167. codecs - support for Unicode encoders/decoders.
  168.  
  169. unicodedata - provides access to the Unicode 3.0 database.
  170.  
  171. _winreg - Windows registry access.
  172.  
  173. encodings - package which provides a large set of standard codecs --
  174. currently only for the new Unicode support. It has a drop-in extension
  175. mechanism which allows you to add new codecs by simply copying them
  176. into the encodings package directory. Asian codec support will
  177. probably be made available as separate distribution package built upon
  178. this technique and the new distutils package.
  179.  
  180.  
  181. Changed Modules
  182. ---------------
  183.  
  184. readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc,
  185. chunk, wave, random, shelve, nntplib - minor enhancements.
  186.  
  187. socket, httplib, urllib - optional OpenSSL support (Unix only).
  188.  
  189. _tkinter - support for 8.0 up to 8.3.  Support for versions older than
  190. 8.0 has been dropped.
  191.  
  192. string - most of this module is deprecated now that strings have
  193. methods.  This no longer uses the built-in strop module, but takes
  194. advantage of the new string methods to provide transparent support for
  195. both Unicode and ordinary strings.
  196.  
  197.  
  198. Changes on Windows
  199. ------------------
  200.  
  201. The installer no longer runs a separate Tcl/Tk installer; instead, it
  202. installs the needed Tcl/Tk files directly in the Python directory.  If
  203. you already have a Tcl/Tk installation, this wastes some disk space
  204. (about 4 Megs) but avoids problems with conflincting Tcl/Tk
  205. installations, and makes it much easier for Python to ensure that
  206. Tcl/Tk can find all its files.  Note: the alpha installers don't
  207. include the documentation.
  208.  
  209. The Windows installer now installs by default in \Python16\ on the
  210. default volume, instead of \Program Files\Python-1.6\.
  211.  
  212.  
  213. Changed Tools
  214. -------------
  215.  
  216. IDLE - complete overhaul.  See the <a href="../idle/">IDLE home
  217. page</a> for more information.  (Python 1.6 alpha 1 will come with
  218. IDLE 0.6.)
  219.  
  220. Tools/i18n/pygettext.py - Python equivalent of xgettext(1).  A message
  221. text extraction tool used for internationalizing applications written
  222. in Python.
  223.  
  224.  
  225. Obsolete Modules
  226. ----------------
  227.  
  228. stdwin and everything that uses it.  (Get Python 1.5.2 if you need
  229. it. :-)
  230.  
  231. soundex.  (Skip Montanaro has a version in Python but it won't be
  232. included in the Python release.)
  233.  
  234. cmp, cmpcache, dircmp.  (Replaced by filecmp.)
  235.  
  236. dump.  (Use pickle.)
  237.  
  238. find.  (Easily coded using os.walk().)
  239.  
  240. grep.  (Not very useful as a library module.)
  241.  
  242. packmail.  (No longer has any use.)
  243.  
  244. poly, zmod.  (These were poor examples at best.)
  245.  
  246. strop.  (No longer needed by the string module.)
  247.  
  248. util.  (This functionality was long ago built in elsewhere).
  249.  
  250. whatsound.  (Use sndhdr.)
  251.  
  252.  
  253. Detailed Changes from 1.6b1 to 1.6
  254. ----------------------------------
  255.  
  256. - Slight changes to the CNRI license.  A copyright notice has been
  257. added; the requirement to indicate the nature of modifications now
  258. applies when making a derivative work available "to others" instead of
  259. just "to the public"; the version and date are updated.  The new
  260. license has a new handle.
  261.  
  262. - Added the Tools/compiler package.  This is a project led by Jeremy
  263. Hylton to write the Python bytecode generator in Python.
  264.  
  265. - The function math.rint() is removed.
  266.  
  267. - In Python.h, "#define _GNU_SOURCE 1" was added.
  268.  
  269. - Version 0.9.1 of Greg Ward's distutils is included (instead of
  270. version 0.9).
  271.  
  272. - A new version of SRE is included.  It is more stable, and more
  273. compatible with the old RE module.  Non-matching ranges are indicated
  274. by -1, not None.  (The documentation said None, but the PRE
  275. implementation used -1; changing to None would break existing code.)
  276.  
  277. - The winreg module has been renamed to _winreg.  (There are plans for
  278. a higher-level API called winreg, but this has not yet materialized in
  279. a form that is acceptable to the experts.)
  280.  
  281. - The _locale module is enabled by default.
  282.  
  283. - Fixed the configuration line for the _curses module.
  284.  
  285. - A few crashes have been fixed, notably <file>.writelines() with a
  286. list containing non-string objects would crash, and there were
  287. situations where a lost SyntaxError could dump core.
  288.  
  289. - The <list>.extend() method now accepts an arbitrary sequence
  290. argument.
  291.  
  292. - If __str__() or __repr__() returns a Unicode object, this is
  293. converted to an 8-bit string.
  294.  
  295. - Unicode string comparisons is no longer aware of UTF-16
  296. encoding peculiarities; it's a straight 16-bit compare.
  297.  
  298. - The Windows installer now installs the LICENSE file and no longer
  299. registers the Python DLL version in the registry (this is no longer
  300. needed).  It now uses Tcl/Tk 8.3.2.
  301.  
  302. - A few portability problems have been fixed, in particular a
  303. compilation error involving socklen_t.
  304.  
  305. - The PC configuration is slightly friendlier to non-Microsoft
  306. compilers.
  307.  
  308.  
  309. ======================================================================
  310.